<template>
	<view class="content">
		<view class="shouyi-back">
			<view class="shouyi">
				<image src="http://hgry.oss-cn-hangzhou.aliyuncs.com/imgs/imgs/wodeshouyi%402x.png"></image>
				<view class="shouyi-tittle">今日收益</view>
				<view class="shouyi-num">{{numFilter(this.todayProfit)}}</view>
				<view class="shuoyi-tixian">提现收益</view>
			</view>
		</view>
		<view class="infos">
			<view class="infos-boxs">
				<view class="infos-boxs-tittle">在途收益</view>
				<view class="infos-boxs-num">{{numFilter(this.freezeProfit)}}</view>
			</view>
			<view class="infos-boxs">
				<view class="infos-boxs-tittle">历史收益</view>
				<view class="infos-boxs-num">{{numFilter(this.historyProfit)}}</view>
			</view>
			<view class="infos-boxs">
				<view class="infos-boxs-tittle">可提现收益</view>
				<view class="infos-boxs-num">{{numFilter(this.cashMoney)}}</view>
			</view>
		</view>
		<view class="shouyimingxi" @tap="goMingxi()">
			<a>收益明细</a>
			<image src="http://hgry.oss-cn-hangzhou.aliyuncs.com/imgs/imgs/shop_you%402x.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				freezeProfit:"",
				historyProfit:"",
				todayProfit:"",
				cashMoney:""
			}
		},
		onLoad(option) {
			let that = this;
			console.log(option);
			that.freezeProfit=option.freezeProfit;
			that.historyProfit=option.historyProfit;
			that.todayProfit=option.todayProfit;
			that.cashMoney=option.cashMoney;
			
			console.log(option.freezeProfit);
			console.log(option.historyProfit);
			console.log(option.todayProfit);
			console.log(option.cashMoney);
			
		},
		methods: {
			numFilter (value) {//收益数计算
			  let realVal = ''
			  if (value) {
			    // 截取当前数据到小数点后两位
			    realVal = parseFloat(value)/100;
							  realVal = realVal.toFixed(2);
			  } else {
			    realVal = '0'
			  }
			  return realVal
			},
			goMingxi(){
				uni.navigateTo({
					url:'../mine-jiaoyimingxi/mine-jiaoyimingxi'
				})
			}
		}
	}
</script>

<style>
	page {
		background: rgba(245, 245, 245, 1);
	}

	.content {
		width: 100%;
		height: 100%;
	}

	.shouyi-back {
		width: 100%;
		height: 100%;
		padding-bottom: 20px;
		background: rgba(255, 255, 255, 1);
	}

	.shouyi {
		padding: 10px 0;
		margin: 0 10px;
		position: relative;
		height: 158px;
		display: flex;
		justify-content: center;
	}

	.shouyi image {
		height: 100%;
		width: 100%;
		position: absolute;
	}

	.shouyi-tittle {
		width: 100%;
		text-align: center;
		position: absolute;
		font-size: 18px;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(255, 255, 255, 1);
		height: 17px;
		line-height: 17px;
		top: 43px;
	}

	.shouyi-num {
		width: 100%;
		height: 19.5px;
		line-height: 19.5px;
		text-align: center;
		font-size: 26px;
		font-family: PingFang SC;
		font-weight: 800;
		color: rgba(255, 255, 255, 1);
		position: absolute;
		top: 69.5px;
	}

	.shuoyi-tixian {
		height: 37.5px;
		background: rgba(255, 186, 0, 1);
		border-radius: 20px;
		position: absolute;
		text-align: center;
		top: 109.5px;
		font-size: 14px;
		font-family: PingFang SC;
		font-weight: bold;
		color: rgba(255, 255, 255, 1);
		line-height: 37.5px;
		padding: 0 22px;
	}

	.infos {
		width: 100%;
		height: 65px;
		display: flex;
		flex-wrap: wrap;
		background: rgba(255, 255, 255, 1);
		margin-top: 10px;
	}

	.infos-boxs {
		width: 33.33%;
		height: 100%;
	}

	.infos-boxs-tittle {
		width: 100%;
		height: 13px;
		line-height: 13px;
		text-align: center;
		padding-top: 14.5px;
		font-size: 14px;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
	}

	.infos-boxs-num {
		font-size: 14px;
		font-family: PingFang SC;
		font-weight: bold;
		color: rgba(26, 26, 26, 1);
		width: 100%;
		height: 11px;
		text-align: center;
		line-height: 11px;
		padding-top: 13.5px;
	}

	.shouyimingxi {
		width: 100%;
		height: 40px;
		background: rgba(255, 255, 255, 1);
		margin-top: 10px;
		display: flex;
		position: relative;
		font-size: 14px;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(51, 51, 51, 1);
		line-height: 40px;
	}
	
	.shouyimingxi a {
		padding-left: 10px;
	}
	
	.shouyimingxi image {
		width: 7px;
		height: 13px;
		position: absolute;
		right: 10px;
		top: 11.5px;
	}
</style>
